import React from 'react'
import {
    useSelector, // useSelector是获取仓库里的数据来用的
    useDispatch, // 派发仓库来用的
    useStore,
} from "react-redux"

function App() {
    const dispatch = useDispatch()

    
    const data = useSelector((state)=>{
        return state.reducer.data
    })
    const btn = () => {
        console.log(111);
        dispatch({
            type:"BTN",
            payload:[6,7,8,9,10],
        })
    }
    console.log(data);
  return (
    <div>
      App
      {
        data&&data.map(item=><div key={item}>{item}</div>)
      }
      <button onClick={btn}>点我更改数据</button>
    </div>
  )
}
export default (App)
